/* Copyright © 2010 LPRM
Universidade Federal do Espírito Santo - RNP-GT CWTools

This file is part of JoinUs!.

JoinUs! is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

JoinUs! is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with JoinUs!. If not, see <http://www.gnu.org/licenses/>. */
package br.ufes.cwtools.joinus.home.campaigns;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

    public class CampView extends LinearLayout {
        public CampView(Context context, View title, View dialogue, boolean expanded, int selected, int size) {
            super(context);
            
            this.setOrientation(VERTICAL);

            addView(title, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            
            mDialogue = (RelativeLayout)dialogue;
            if(mDialogue!=null){
            addView(mDialogue, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,size));
            
            mDialogue.setVisibility(expanded ? VISIBLE : GONE);
            }

        }
        
        /**
         * Convenience method to set the title of a SpeechView
         */
        public void setTitle(View title) {
            mTitle=title;
        }
        
        /**
         * Convenience method to set the dialogue of a SpeechView
         */
        public void setDialogue(View view) {
            mDialogue=(RelativeLayout)view;
        }
        
        /**
         * Convenience method to expand or hide the dialogue
         */
        public void setExpanded(boolean expanded) {
            mDialogue.setVisibility(expanded ? VISIBLE : GONE);
        }
        
        @SuppressWarnings("unused")
		private View mTitle;
        private RelativeLayout mDialogue;
    }